package ui;

import android.hardware.Camera;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.SurfaceView;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.FrameLayout;

import com.example.demon.cameratest.R;

import tools.CameraInterface;
import view.CameraPreview;

/**
 * @author jianjunhuang.me@foxmail.com
 * @since 2017/1/11
 */

public class MCameraActivity extends AppCompatActivity{

    private Camera mCamera;
    private CameraPreview mPreview;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        //隐藏状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.camera_activity);
        mCamera = CameraInterface.getCameraInstanc();

        mPreview = new CameraPreview(this,mCamera);
        FrameLayout preview = (FrameLayout) findViewById(R.id.camera_show_fl);
        preview.addView(mPreview);

    }
}
